home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 109 / EnigmaAmiga109CD.iso / dalla rivista / host contacted / jikes.lha / jikes-1.11 / src / jcl / jcl_access.h < prev    next >
C/C++ Source or Header  |  1999-11-04  |  3KB  |  69 lines

  1. // $Id: jcl_access.h,v 1.1 1999/11/04 18:48:03 shields Exp $
  2. //
  3. // This software is subject to the terms of the IBM Jikes Compiler
  4. // License Agreement available at the following URL:
  5. // http://www.ibm.com/research/jikes.
  6. // Copyright (C) 1996, 1998, International Business Machines Corporation
  7. // and others.  All Rights Reserved.
  8. // You must accept the terms of that agreement to use this software.
  9. //
  10. #ifndef jcl_access_INCLUDED
  11. #define jcl_access_INCLUDED
  12.  
  13. #include "jcl_bool.h"
  14. #include "jcl_int.h"
  15. #include <stream.h>
  16.  
  17. class AccessFlags
  18. {
  19. public:
  20.     bool ACC_PUBLIC()       { return access_flags & 0x0001; }
  21.     bool ACC_PRIVATE()      { return access_flags & 0x0002; }
  22.     bool ACC_PROTECTED()    { return access_flags & 0x0004; }
  23.     bool ACC_STATIC()       { return access_flags & 0x0008; }
  24.     bool ACC_FINAL()        { return access_flags & 0x0010; }
  25.     bool ACC_SYNCHRONIZED() { return access_flags & 0x0020; }
  26.     bool ACC_VOLATILE()     { return access_flags & 0x0040; }
  27.     bool ACC_TRANSIENT()    { return access_flags & 0x0080; }
  28.     bool ACC_NATIVE()       { return access_flags & 0x0100; }
  29.     bool ACC_INTERFACE()    { return access_flags & 0x0200; }
  30.     bool ACC_ABSTRACT()     { return access_flags & 0x0400; }
  31.  
  32.     void set_ACC_PUBLIC()       { access_flags |= 0x0001; }
  33.     void set_ACC_PRIVATE()      { access_flags |= 0x0002; }
  34.     void set_ACC_PROTECTED()    { access_flags |= 0x0004; }
  35.     void set_ACC_STATIC()       { access_flags |= 0x0008; }
  36.     void set_ACC_FINAL()        { access_flags |= 0x0010; }
  37.     void set_ACC_SYNCHRONIZED() { access_flags |= 0x0020; }
  38.     void set_ACC_VOLATILE()     { access_flags |= 0x0040; }
  39.     void set_ACC_TRANSIENT()    { access_flags |= 0x0080; }
  40.     void set_ACC_NATIVE()       { access_flags |= 0x0100; }
  41.     void set_ACC_INTERFACE()    { access_flags |= 0x0200; }
  42.     void set_ACC_ABSTRACT()     { access_flags |= 0x0400; }
  43.  
  44.     u2 access_flags;
  45.  
  46.     AccessFlags() : access_flags(0) {}
  47.     AccessFlags(u2& _access_flags) : access_flags(_access_flags) {}
  48.  
  49. #ifdef TEST
  50.         void print() {
  51.                 cout << "access_flags: ";
  52.                 if (ACC_PUBLIC())       cout << " public";
  53.                 if (ACC_PRIVATE())      cout << " private";
  54.                 if (ACC_PROTECTED())    cout << " protected";
  55.                 if (ACC_STATIC())       cout << " static";
  56.                 if (ACC_FINAL())        cout << " final";
  57.                 if (ACC_SYNCHRONIZED()) cout << " synchronized_or_super";
  58.                 if (ACC_VOLATILE())     cout << " volatile";
  59.                 if (ACC_TRANSIENT())    cout << " transient";
  60.                 if (ACC_NATIVE())       cout << " native";
  61.                 if (ACC_INTERFACE())    cout << " interface";
  62.                 if (ACC_ABSTRACT())     cout << " abstract";
  63.                 cout << "\n";
  64.         }
  65. #endif
  66. };
  67.  
  68. #endif
  69.